import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

let routes = [{
        path: "/",
        redirect: "home"
    },
    {
        path: '/home',
        name: "home",
        component: () => import('@/view/home/Home.vue')
    },
    {
        path: "/category",
        name: "category",
        component: () => import('@/view/category/Category.vue')
    },
    {
        path: "/goodsList/:id",
        name: "goodsList",
        component: () => import('@/view/detail/GoodsList.vue')

    },
    {
        path: "/gooddetail/:cid",
        name: "gooddetail",
        component: () => import('@/view/detail/GoodDetail.vue')
    },

    {
        path: '/cart',
        name: 'cart',
        component: () => import('@/view/cart/Cart.vue')
    },
    {
        path: '/profile',
        name: 'profile',
        component: () => import('@/view/profile/Profile.vue')
    }
]


const router = new VueRouter({
    routes,
    mode: "history"
})

export default router